<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Object.is()</title>
</head>
<body>
    <h1>Object.is()</h1>
    <script>
        // Object.is()的基本用法示例
        console.log(Object.is('foo', 'foo')); // true
        console.log(Object.is({}, {})); // false
        
        // 与===的区别
        console.log(+0 === -0); // true
        console.log(Object.is(+0, -0)); // false
        
        console.log(NaN === NaN); // false
        console.log(Object.is(NaN, NaN)); // true
    </script>
</body>
</html> 